package com.ganmiao.server.file.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ganmiao.server.file.entity.GmAttachment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Author zero.yin
 * @Date 2022/8/14 2:49 PM
 * @Desc
 */
@Mapper
public interface GmAttachmentMapper extends BaseMapper<GmAttachment> {

    /***
     * 查询需preview附件
     */
    @Select({"<script>",
            "select t1.* from gm_attachment t1 where t1.kkpreview_flag = '0' and t1.status = '1' order by t1.created_time desc",
            "</script>"})
    IPage<GmAttachment> queryPreviewAttachment(@Param("page") IPage<GmAttachment> page);
}
